Ext.define('Service.role.view.RoleDataListGrid', {
    extend: 'Ext.grid.Panel',
    alias: 'widget.Service_role_view_RoleDataListGrid',
	border : false,
    title: '',
    forceFit : true,
    frame : false,
    layout : 'fit',
	columnLines : true,
	loadMask : true,
	
	viewConfig : {
		stripeRows : true
	},

    initComponent: function() {
        var me = this;
		me.store = Ext.create('Service.role.store.RoleDataListStore');
        Ext.applyIf(me, {
            columns: [
                {
                    xtype: 'gridcolumn',
                    dataIndex: 'roleName',
                    text: '角色名称',
                    sortable: true
                },
                {
                    xtype: 'gridcolumn',
                    dataIndex: 'roleText',
                    text: '展示名称',
                    sortable: true
                },
                {
                    xtype: 'gridcolumn',
                    dataIndex: 'validFlagText',
                    text: '启用标识'
                },
                {
                    xtype: 'datecolumn',
                    dataIndex: 'createTime',
                    text: '创建日期',
                    format : 'Y-m-d',
                    sortable: true
                },
                {
                    xtype: 'gridcolumn',
                    dataIndex: 'createUserName',
                    text: '创建人'
                },
                {
                    xtype: 'datecolumn',
                    dataIndex: 'updateTime',
                    text: '更新日期',
                    format : 'Y-m-d',
                    sortable: true
                },
                {
                    xtype: 'gridcolumn',
                    dataIndex: 'updateUserName',
                    text: '更新人'
                },
                {
                    xtype: 'gridcolumn',
                    dataIndex: 'remark',
                    text: '备注'
                }
            ],
            selModel: Ext.create('Ext.selection.CheckboxModel', {}),
            bbar : {
                xtype: 'cnpbar',
                store : me.store
			},
            dockedItems: [
                {
                    xtype: 'toolbar',
                    dock: 'top',
                    items: [
                        {
                            xtype: 'button',
                            width: 80,
                            icon : Constants.SER_RES_PATH + 'icon/share/user_add.gif',
                            text: '添加角色',
                            module: 'Service_role',
                            action: 'addRole',
                            id: 'Service_role_btn_show_RoleAddWindow'
                        },
                        '-',
                        {
                            xtype: 'button',
                            width: 80,
                            icon : Constants.SER_RES_PATH + 'icon/share/user_edit.png',
                            text: '修改角色',
                            module: 'Service_role',
                            action: 'chgRole',
                            id: 'Service_role_btn_show_RoleChgWindow'
                        },
                        '-',
                        {
                            xtype: 'button',
                            width: 80,
                            icon : Constants.SER_RES_PATH + 'icon/share/user_delete.gif',
                            text: '批量删除',
                            module : 'Service_role',
                            action : 'delRoles',
                            id: 'Service_role_btn_batchDel_Roles'
                        },
                        '->',
                        {
                            xtype: 'textfield',
                            padding: '',
                            fieldLabel: '',
                            emptyText: '输入搜索条件'
                        },
                        {
                            xtype: 'button',
                            width: 23,
                            height : 21,
                           	cls : 'ux-search-btn',
                           	overCls : 'ux-search-btn-over'
                        }
                    ]
                }
            ]
        });
 		me.store.loadPage(1,{});
        me.callParent(arguments);
    }

});